package cosplay.Services;

import java.util.ArrayList;
import java.util.List;

import cosplay.Beans.Tags;

public class TagServices {
	public static String getStringFromTagList(List<Tags> tag)
	{
		String result="";
		if(tag.size()>0)
		{
			for (Tags temp:tag)
			{
				result+=temp.getWord()+",";
			}
			result=result.trim();
			result=result.substring(0, result.length()-1);
		}
		return result;
	}
	public static List<Tags> removeAllFromOther(List<Tags> from, List<Tags> to)
	{
		List<Tags> result=new ArrayList<Tags>();
		for(Tags f:from)
		{
			boolean contains=false;
			for(Tags t:to)
			{
				if (f.getWord().equals(t.getWord()))
				{
					contains=true;
					continue;
				}
			}
			if(!contains)
				result.add(f);
		}
		return result;
	}

}
